﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="msg_receive_back.aspx.cs" Inherits="Ccit.SysPlat.Remind.msg_receive_back" %>

<%@ Register TagPrefix="ccit" TagName="attach" Src="../UserControls/AttachUpLoad.ascx" %>

<%@ Register TagPrefix="ccit" Namespace="Ccit.ServerControls" Assembly="Ccit.ServerControls.ActionForm" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>在线消息</title>
    <script language="javascript" type="text/javascript" src="../script/jbase64.js"></script>
    
    <script type="text/javascript" language="javascript">
        /* UpLoad File */
        function doUploadFile()
        {
            OpenUpLoadPage();
        }
        /* 发送 */ 
        function doSend() {
            var receiverId = document.getElementById("_hidReceiverId").value;
            if(receiverId == "") {
                alert("收件人为空,不能发送消息!!");
                return false;
            }
            var MsgContent = document.getElementById("txtaraContent").value;
            if(MsgContent == "")
            {
                alert("消息内容不能为空");
                return false;
            }            
            var userId = document.getElementById("_hidReceiverId").value;       
            PageMethods.ReplyMsg(MsgContent,userId,ClientCallBack);
        }
        
        function ClientCallBack(vResult)
        {
            eval("var vResult = " + vResult);
            alert(vResult.oMsg);
            
            if(vResult.oFlag > 0)
                doCancle();
        }
        
        /* 取消 */ 
        function doCancle()
        {
           var PageFrom = document.getElementById("_hidPageSource").value;
           if(PageFrom == "3") //消息查看 
           {
                window.opener.__doPostBack("lnkSearch","");
           }
           else if(PageFrom == "1") //接收消息列表
           {
               window.opener.__doPostBack("lnkSearch","");
           }
           else if(PageFrom == "5")//近期联系人
           {
                window.opener.__doPostBack("lnkSearch","");
           }
           else if(PageFrom == "6")//近期消息浏览
           {
                window.opener.__doPostBack("lnkSearch","");
           }
           else if(PageFrom == "7")  //消息提醒
           { 
              window.opener.document.getElementById("_hidOpenWin").value = "0";
              window.opener.startRun();
              window.opener.doNext();
              window.close();
           }
           else if(PageFrom == "4")
           {
                window.close();
           }
           window.close();
        }
        
        function onLoad()
        {
           var vPageSource = document.getElementById("_hidPageSource").value;
           if(vPageSource == "7") //消息提醒
           {
                window.opener.stopRun();
           }
        }
        
    </script>
</head>
<body onload="onLoad()">
    <ccit:ActionForm id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
    </asp:ScriptManager>
    
    <input type="hidden" id="_hidReceiverId" runat="server" />
    <input type="hidden" id="_hidPageSource" runat="server" />
    <input type="hidden" id="_hidCurCount" runat="server" />
    <input type="hidden" id="_hidMsgId" runat="server" />
    <input type="hidden" id="_hidFlag" runat="server" />
    
    
     <table cellpadding="0" cellspacing="0" class="tbToolbar" width="98%" align="center">
      <tr>
        <td align="left">
          <div class="tbSeparator"></div>
        </td>
        <td width="100%" class="titlebar">在线消息-消息回复</td>
        <td align="right">
          <div class="tbSeparator"></div>
        </td>
      </tr>
    </table>
    
    <table class="tableborder" cellpadding="0" cellspacing="0" width="98%" align="center" runat="server" id="tab1">
        <tr>
            <td width="6%" class="pformleft" align="right"><nobr>收件人</nobr></td>
            <td width="94%"  class="pformright">
              <input type="text" id="txtReceiver" runat="server" style="width:99%" class="input" readonly/>
            </td>
        </tr>
        <tr>
            <td width="6%" class="pformleft" align="right" valign="top"><nobr><font color="red">*</font>内容</nobr></td>
            <td width="94%" class="pformright">
               <textarea id="txtaraContent" rows="5" class="inputarea" runat="server" cols="30" style="width:99%;" ></textarea> 
            </td>
        </tr>
        <tr>
            <td width="6%"  class="pformleft">附件</td>
            <td class="pformright" >
                <a id="A1" href="javascript:doUploadFile()" runat="server" class="linktext">上传附件</a>
            </td>
          </tr>
          <tr>
            <td class="pformright" colspan="2"  align="left">
                <ccit:attach id="ucAttach" ShowStyle="1" runat="server"></ccit:attach>
            </td>
          </tr>
        <tr class="pformstrip">
            <td colspan="2" align="center">
            <input type="button" id="btnSave" onclick="doSend()" value="发送" class="button"  runat="server" />
            &nbsp;
                <input type="button" id="btnSaveAdd" onclick="doCancle()" value="取消" class="button" runat="server" />
            </td>
         </tr>
       </table>
     
    </ccit:ActionForm>
</body>
</html>
